-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimental migration support for POSIX #441
Conversation
61fc3f0
to
0980818
Compare
0980818
to
80e52e0
Compare
api/layout/paths.go
Outdated
type RangeInfo struct { | ||
// StartIndex is the index of the first entry bundle the range touches. | ||
StartIndex uint64 | ||
// StartPartial is non-zero if the bundle at StartIndex is expected to be partial. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add something that this value references the first index into the bundle? i.e. (256 * StartIndex) + StartPartial
is the index that this starts from?
At the moment the docs suggest this StartPartial
is basically a boolean in disguise.
3bff6b5
to
44ee4f6
Compare
5f9abb3
to
efdee12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still reviewing, but here's some comments.
todo chan bundle | ||
|
||
// bundlesToMigrate is the total number of entry bundles which need to be copied. | ||
bundlesToMigrate uint64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Access to this field looks racy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right - changed the approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't even need to be a field now. Can just be a local variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a README.md
in cmd/experimental/migrate
would be helpful to tell how to try this migration tool.
6d77318
to
c6143a5
Compare
Good call, but I'll add that in a follow up soon, this PR is already a bit large... |
func Migrate(ctx context.Context, numWorkers int, sourceSize uint64, sourceRoot []byte, getEntries client.EntryBundleFetcherFunc, storage MigrationStorage) error { | ||
klog.Infof("Starting migration; source size %d root %x", sourceSize, sourceRoot) | ||
|
||
// TODO store state & resume |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naked TODO considered harmful. Before submit, can we have this fixed, a name attached, or an issue created and linked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the TODO - currently if the job crashes and is restarted, it'll pick up from the size of the locally integrated tree. That's likely good enough for now.
This PR adds experimental migration support for migrating into POSIX logs.
Towards #436